//
//  ZTXChuLiHeaderCell.m
//  NtoccDriverNew
//
//  Created by 张天兴 on 2023/12/7.
//  Copyright © 2023 GCY. All rights reserved.
//

#import "ZTXChuLiHeaderCell.h"

@implementation ZTXChuLiHeaderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (CGFloat)heightCentent:(NSString *)str{
    return [self getWidthWithText:str Width:(ScreenW - 100) height:0 font:15.f] + 20;
}
+ (CGFloat)getWidthWithText:(NSString *)text Width:(CGFloat)width height:(CGFloat)height font:(CGFloat)font
{
    //内容宽度自适应
    CGSize size = CGSizeMake(width, height);
    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:font]};
    CGRect rect = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:dic context:nil];
    if (height == 0) {
        return rect.size.height;
    }else {
        return rect.size.width;
    }
}
@end
